/*
 * Copyright NetEnrich, Inc. All rights reserved. NetEnrich
 * PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
 */
package com.apptonelabs.vphonevisor;

import java.net.Inet4Address;
import java.net.InetSocketAddress;
import java.util.concurrent.Executors;

import org.jboss.netty.bootstrap.ServerBootstrap;
import org.jboss.netty.channel.socket.nio.NioServerSocketChannelFactory;

import com.apptonelabs.vphonevisor.netty.VPhoneVisorProtocolCodecFactory;

public class VPhoneVisorNetty {
    public static void main(String[] args) throws Exception {
    	
    	ServerBootstrap bootstrap = new ServerBootstrap(
				new NioServerSocketChannelFactory(Executors
						.newCachedThreadPool(), Executors
						.newCachedThreadPool()));

		// Set up the pipeline factory.
		bootstrap.setPipelineFactory(new VPhoneVisorProtocolCodecFactory());

		// Bind and start to accept incoming connections.
		bootstrap.bind(new InetSocketAddress(Inet4Address.getByName("127.0.0.1"), 443));
		System.out.println("VPhoneVisor Netty Server @ 443");
    }
}
